<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html 
     PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
  <title>Module: Rails::Generator::Options::ClassMethods</title>
  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
  <meta http-equiv="Content-Script-Type" content="text/javascript" />
  <link rel="stylesheet" href="../../../.././rdoc-style.css" type="text/css" media="screen" />
  <script type="text/javascript">
  // <![CDATA[

  function popupCode( url ) {
    window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
  }

  function toggleCode( id ) {
    if ( document.getElementById )
      elem = document.getElementById( id );
    else if ( document.all )
      elem = eval( "document.all." + id );
    else
      return false;

    elemStyle = elem.style;
    
    if ( elemStyle.display != "block" ) {
      elemStyle.display = "block"
    } else {
      elemStyle.display = "none"
    }

    return true;
  }
  
  // Make codeblocks hidden by default
  document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
  
  // ]]>
  </script>

</head>
<body>



    <div id="classHeader">
        <table class="header-table">
        <tr class="top-aligned-row">
          <td><strong>Module</strong></td>
          <td class="class-name-in-header">Rails::Generator::Options::ClassMethods</td>
        </tr>
        <tr class="top-aligned-row">
            <td><strong>In:</strong></td>
            <td>
                <a href="../../../../files/vendor/rails/railties/lib/rails_generator/options_rb.html">
                vendor/rails/railties/lib/rails_generator/options.rb
                </a>
        <br />
            </td>
        </tr>

        </table>
    </div>
  <!-- banner header -->

  <div id="bodyContent">



  <div id="contextContent">



   </div>

    <div id="method-list">
      <h3 class="section-bar">Methods</h3>

      <div class="name-list">
      <a href="#M001487">default_options</a>&nbsp;&nbsp;
      <a href="#M001488">full_options</a>&nbsp;&nbsp;
      <a href="#M001485">inherited_with_options</a>&nbsp;&nbsp;
      <a href="#M001486">mandatory_options</a>&nbsp;&nbsp;
      </div>
    </div>

  </div>


    <!-- if includes -->

    <div id="section">





      


    <!-- if method_list -->
    <div id="methods">
      <h3 class="section-bar">Public Instance methods</h3>

      <div id="method-M001487" class="method-detail">
        <a name="M001487"></a>

        <div class="method-heading">
          <a href="#M001487" class="method-signature">
          <span class="method-name">default_options</span><span class="method-args">(options = nil)</span>
          </a>
        </div>
      
        <div class="method-description">
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M001487-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M001487-source">
<pre>
    <span class="ruby-comment cmt"># File vendor/rails/railties/lib/rails_generator/options.rb, line 30</span>
30:         <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">default_options</span>(<span class="ruby-identifier">options</span> = <span class="ruby-keyword kw">nil</span>)
31:           <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">options</span>
32:             <span class="ruby-identifier">write_inheritable_attribute</span>(<span class="ruby-identifier">:default_options</span>, <span class="ruby-identifier">options</span>)
33:           <span class="ruby-keyword kw">else</span>
34:             <span class="ruby-identifier">read_inheritable_attribute</span>(<span class="ruby-identifier">:default_options</span>) <span class="ruby-keyword kw">or</span> <span class="ruby-identifier">write_inheritable_attribute</span>(<span class="ruby-identifier">:default_options</span>, {})
35:           <span class="ruby-keyword kw">end</span>
36:         <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M001488" class="method-detail">
        <a name="M001488"></a>

        <div class="method-heading">
          <a href="#M001488" class="method-signature">
          <span class="method-name">full_options</span><span class="method-args">(runtime_options = {})</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
Merge together our class options. In increasing precedence:
</p>
<pre>
  default_options   (class default options)
  runtime_options   (provided as argument)
  mandatory_options (class mandatory options)
</pre>
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M001488-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M001488-source">
<pre>
    <span class="ruby-comment cmt"># File vendor/rails/railties/lib/rails_generator/options.rb, line 42</span>
42:         <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">full_options</span>(<span class="ruby-identifier">runtime_options</span> = {})
43:           <span class="ruby-identifier">default_options</span>.<span class="ruby-identifier">merge</span>(<span class="ruby-identifier">runtime_options</span>).<span class="ruby-identifier">merge</span>(<span class="ruby-identifier">mandatory_options</span>)
44:         <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M001485" class="method-detail">
        <a name="M001485"></a>

        <div class="method-heading">
          <a href="#M001485" class="method-signature">
          <span class="method-name">inherited_with_options</span><span class="method-args">(sub)</span>
          </a>
        </div>
      
        <div class="method-description">
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M001485-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M001485-source">
<pre>
    <span class="ruby-comment cmt"># File vendor/rails/railties/lib/rails_generator/options.rb, line 17</span>
17:         <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">inherited_with_options</span>(<span class="ruby-identifier">sub</span>)
18:           <span class="ruby-identifier">inherited_without_options</span>(<span class="ruby-identifier">sub</span>) <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">respond_to?</span>(<span class="ruby-identifier">:inherited_without_options</span>)
19:           <span class="ruby-identifier">sub</span>.<span class="ruby-identifier">extend</span>(<span class="ruby-constant">Rails</span><span class="ruby-operator">::</span><span class="ruby-constant">Generator</span><span class="ruby-operator">::</span><span class="ruby-constant">Options</span><span class="ruby-operator">::</span><span class="ruby-constant">ClassMethods</span>)
20:         <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M001486" class="method-detail">
        <a name="M001486"></a>

        <div class="method-heading">
          <a href="#M001486" class="method-signature">
          <span class="method-name">mandatory_options</span><span class="method-args">(options = nil)</span>
          </a>
        </div>
      
        <div class="method-description">
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M001486-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M001486-source">
<pre>
    <span class="ruby-comment cmt"># File vendor/rails/railties/lib/rails_generator/options.rb, line 22</span>
22:         <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">mandatory_options</span>(<span class="ruby-identifier">options</span> = <span class="ruby-keyword kw">nil</span>)
23:           <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">options</span>
24:             <span class="ruby-identifier">write_inheritable_attribute</span>(<span class="ruby-identifier">:mandatory_options</span>, <span class="ruby-identifier">options</span>)
25:           <span class="ruby-keyword kw">else</span>
26:             <span class="ruby-identifier">read_inheritable_attribute</span>(<span class="ruby-identifier">:mandatory_options</span>) <span class="ruby-keyword kw">or</span> <span class="ruby-identifier">write_inheritable_attribute</span>(<span class="ruby-identifier">:mandatory_options</span>, {})
27:           <span class="ruby-keyword kw">end</span>
28:         <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>


    </div>


  </div>


<div id="validator-badges">
  <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
</div>

</body>
</html>